package com.symaster.common.util;

public class CountWaitUtil {
        private final int count;
        private int wakeCount = 0;

        public CountWaitUtil(int count) {
            this.count = count;
        }

        public synchronized void wake() {
            wakeCount++;
            if (wakeCount >= count) {
                synchronized (this) {
                    this.notifyAll();
                }
                wakeCount = 0;
            }
        }
    }